<?php

session_start();
include('database.php');




$query="update users set status='active' where user_id='$_GET[user_id]'";
mysqli_query($mysqli,$query);

$query ="select * from users where user_id='$_GET[user_id]'";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
if($result->num_rows == 1) {
		while($row = $result->fetch_array()) {
		
$_SESSION[user_id]=$_GET[user_id];

header('Location: email.php?email='.$row[email].'&user_id='.$_GET[user_id].' ');

}}
?>